package com.jjapp.db;

import java.sql.Connection;
import java.sql.DriverManager;

public class Database {
	static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
	static final String DB_URL = "jdbc:mysql://localhost:3306/test";
	// Database credentials
	static final String USER = "jjapp";
	static final String PASS = "jjapp";

	public static Connection getDBConnection() {
		Connection conn=null;
		try {
			// Register JDBC driver
			Class.forName("com.mysql.jdbc.Driver");
			// Open a connection
			conn = DriverManager.getConnection(DB_URL, USER, PASS);

		} catch (Exception e) {
			e.printStackTrace();
		}
		return conn;
	}
}
